1.1 - C# Comments


What are comments and what are they used for?

Comments are the most basic feature in programming, they are used to keep track of what something do and so explain what a piece of code do.
Writing a comment in code is the most simple stuff to do. You just write two slash // like so and the row after them will be a comment where you can write your text.


protected override void OnGameStart()
{
    // this is a comment text
}
            

Multi-line comments

If you want to do a multi-line comment you have to follow a different syntax.
The start of the comment is declared as a slash and asterisk /*, while the end of it with an asterisk and a slash */ (basically the opposite)


protected override void OnGameStart()
{
    // this is a comment text

    /*
        This is
        a multi-line
        comment
    */
}        
            

Example


// this method gets executed right before gaining player control            
protected override void OnGameStart()
{
    // here I write what I want to do
}